<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/10/17
 * Time: 15:39
 */

namespace app\controllers\Project_1_0;

use Core\Controller;
class Add extends Controller
{
    function add(){
        $tp = loadLibrary("Mytp");
        $tp->tp("add/add");
    }

    function addData()
    {
        $name=$_POST["name"];
        $dealer=$_POST["dealer"];
        $receive=$_POST["receive"];
        $except=$_POST["except"];
        $status=$_POST["status"];

        $add=new \app\models\Project_1_0\Add();
        $res=$add->add($name,$dealer,$receive,$except,$status);
        if($res>0){
            $this->success("添加成功","index.php?action=cases&func=index");
        }else{
            $this->error("添加失败！");
        }
    }
}